﻿@using giaoxuhaison.Models;

@{
    ViewBag.Title = "NewNews";
}

@{
    var lstItem = (List<vw_All>)ViewData["lstNews"];
    //var lstOtherNews = (List<vw_NewsAll>)ViewData["lstOtherNews"];        
    
}

@*<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>*@
<script src='@Url.Content("~/Scripts/News/jquery.infinitecarousel.js")' type="text/javascript"></script>

<script type="text/javascript">
    $(function () {
        $('#carousel1').infiniteCarousel();
    });
</script>

<style type="text/css">
#carousel1 {
	width:500px;
	height:330px;
	overflow:scroll;
	border-bottom:1px solid #C0C0C0;
}
.textholder {
	text-align:left;
	font-size:small;
	padding:6px;
	-moz-border-radius: 6px 6px 0 0;
	-webkit-border-top-left-radius: 6px;	
	-webkit-border-top-right-radius: 6px;
}
.NewsPanel
{
    float:left;
    margin: 5px 5px 5px 10px;
    text-align: justify;
    width: 285px;
    font-size:13.5px;
    in-line:1.5;
    overflow:hidden;
}
</style>

<div id="carousel1">
	<ul>

        @if (lstItem != null && lstItem.Count > 0)
        {
            foreach (var item in lstItem)
            {
                <li>
                    @if (item.GroupID == 1 || item.GroupID == 2 || item.GroupID == 3 || item.GroupID == 4)
                    {
                        <a href='@Url.Action("NewsDetail", "News", new { NewsID = item.NewsID, GroupID = item.GroupID })'>
		                <img class="slideshow" alt="" src='@Url.Content(item.ImageContentUrl)' style="width:235px; height:180px; max-width:235px; max-height:180px;float:left; margin:5px 0px 5px 5px;"/>
                        </a>
                        <div class="NewsPanel"><a href='@Url.Action("NewsDetail", "News", new { NewsID = item.NewsID, GroupID = item.GroupID })'>@item.Subject
                        @{
                        TimeSpan diff = DateTime.Today.Date - item.CreationDate.Date;

                        if (Int32.Parse(diff.Days.ToString()) <= 3)
                        {
                                <img id="start" src='@Url.Content("~/Images/red-star.gif")' alt = ""/>
                        }
                        }
                        </a>
                         <br /><br />
                            @item.ShortcutText...
                        </div>
                    }
                    else if (item.GroupID == 5 || item.GroupID == 6 || item.GroupID == 7 || item.GroupID == 8)
                    {
                        <a href='@Url.Action("GodTitleDetail", "GodTitle", new { GodTitleID = item.NewsID, GroupID = item.GroupID })'>
		                <img class="slideshow" alt="" src='@Url.Content(item.ImageContentUrl)' style="width:235px; height:180px; max-width:235px; max-height:180px;float:left; margin:5px 0px 5px 5px;"/>
                        </a>
                        <div class="NewsPanel"><a href='@Url.Action("GodTitleDetail", "GodTitle", new { GodTitleID = item.NewsID, GroupID = item.GroupID })'>@item.Subject
                        @{
                        TimeSpan diff = DateTime.Today.Date - item.CreationDate.Date;

                        if (Int32.Parse(diff.Days.ToString()) <= 3)
                        {
                                <img id="start" src='@Url.Content("~/Images/red-star.gif")' alt = ""/>
                        }
                        }
                        </a> <br /><br />
                            @item.ShortcutText...
                        </div>
                    }
                    else if (item.GroupID == 9 || item.GroupID == 10)
                    {
                        <a href='@Url.Action("LiturgyDetail", "Liturgies", new { LiturgyID = item.NewsID, GroupID = item.GroupID })'>
		                <img class="slideshow" alt="" src='@Url.Content(item.ImageContentUrl)' style="width:235px; height:180px; max-width:235px; max-height:180px;float:left; margin:5px 0px 5px 5px;"/>
                        </a>
                        <div class="NewsPanel"><a href='@Url.Action("LiturgyDetail", "Liturgies", new { LiturgyID = item.NewsID, GroupID = item.GroupID })'>@item.Subject
                        @{
                        TimeSpan diff = DateTime.Today.Date - item.CreationDate.Date;

                        if (Int32.Parse(diff.Days.ToString()) <= 3)
                        {
                                <img id="start" src='@Url.Content("~/Images/red-star.gif")' alt = ""/>
                        }
                        }
                        </a> <br /><br />
                            @item.ShortcutText...
                        </div>                        
                    }
                    else if (item.GroupID == 11 || item.GroupID == 12)
                    {
                        <a href='@Url.Action("FaithsDetail", "Faiths", new { FaithID = item.NewsID, GroupID = item.GroupID })'>
		                <img class="slideshow" alt="" src='@Url.Content(item.ImageContentUrl)' style="width:235px; height:180px; max-width:235px; max-height:180px;float:left; margin:5px 0px 5px 5px;"/>
                        </a>
                        <div class="NewsPanel"><a href='@Url.Action("FaithsDetail", "Faiths", new { FaithID = item.NewsID, GroupID = item.GroupID })'>@item.Subject
                        @{
                        TimeSpan diff = DateTime.Today.Date - item.CreationDate.Date;

                        if (Int32.Parse(diff.Days.ToString()) <= 3)
                        {
                                <img id="start" src='@Url.Content("~/Images/red-star.gif")' alt = ""/>
                        }
                        }
                        </a> <br /><br />
                            @item.ShortcutText...
                        </div>
                    }
                    @*phan thanh kinh*@
                    else if (item.GroupID == 50 || item.GroupID == 51)
                    {
                        <a href='@Url.Action("BibleDetail", "Bibles", new { BibleID = item.NewsID, GroupID = item.GroupID })'>
		                <img class="slideshow" alt="" src='@Url.Content(item.ImageContentUrl)' style="width:235px; height:180px; max-width:235px; max-height:180px;float:left; margin:5px 0px 5px 5px;"/>
                        </a>
                        <div class="NewsPanel"><a href='@Url.Action("BibleDetail", "Bibles", new { BibleID = item.NewsID, GroupID = item.GroupID })'>@item.Subject
                        @{
                        TimeSpan diff = DateTime.Today.Date - item.CreationDate.Date;

                        if (Int32.Parse(diff.Days.ToString()) <= 3)
                        {
                                <img id="start" src='@Url.Content("~/Images/red-star.gif")' alt = ""/>
                        }
                        }
                        </a> <br /><br />
                            @item.ShortcutText...
                        </div>
                    }
                    else if (item.GroupID == 13 || item.GroupID == 14)
                    {
                        <a href='@Url.Action("CultureDetail", "Culture", new { CultureID = item.NewsID, GroupID = item.GroupID })'>
		                <img class="slideshow" alt="" src='@Url.Content(item.ImageContentUrl)' style="width:235px; height:180px; max-width:235px; max-height:180px;float:left; margin:5px 0px 5px 5px;"/>
                        </a>
                        <div class="NewsPanel"><a href='@Url.Action("CultureDetail", "Culture", new { CultureID = item.NewsID, GroupID = item.GroupID })'>@item.Subject
                        @{
                        TimeSpan diff = DateTime.Today.Date - item.CreationDate.Date;

                        if (Int32.Parse(diff.Days.ToString()) <= 3)
                        {
                                <img id="start" src='@Url.Content("~/Images/red-star.gif")' alt = ""/>
                        }
                        }
                        </a> <br /><br />
                            @item.ShortcutText...
                        </div>
                    }
                    
                    @*<p><a href='@Url.Action("NewsDetail", "News", new { NewsID = item.NewsID, GroupID = item.GroupID })'>
                    @item.Subject
                    </a></p> *@   
		        </li>                         
            }
        }  
        

		@*<li>

		<img alt="" src='@Url.Content("~/Images/News/TitleImages/img-12.jpg")'  width="500" height="330" /><p>Many of the images used in the demos come from
		<a href="#">Mike Swanson's excellent wallpaper images</a> page.</p>
		</li>
		<li>
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/img-13.jpg")'  width="500" height="330" /></li>
		<li>
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/img-14.jpg")'  width="500" height="330"  /><p>The images to the left and right of this one have no caption.</p>
        </li>
        <li>
        <a href="#">
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/test.jpg")' width="500" height="330" /></a>
        <p><a href="#">This carousel 
		has padding applied to it so you can see hints for the previous and taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
		next images.</a></p>        
		</li>
        <li>
        <a href="#">
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/test.jpg")' width="500" height="330" /></a>
        <p><a href="#">This carousel 
		has padding applied to it so you can see hints for the previous and taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
		next images.</a></p>        
		</li>
        <li>
        <a href="#">
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/test.jpg")' width="500" height="330" /></a>
        <p><a href="#">This carousel 
		has padding applied to it so you can see hints for the previous and taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
		next images.</a></p>        
		</li>
        <li>
        <a href="#">
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/test.jpg")' width="500" height="330" /></a>
        <p><a href="#">This carousel 
		has padding applied to it so you can see hints for the previous and taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
		next images.</a></p>        
		</li>
        <li>
        <a href="#">
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/test.jpg")' width="500" height="330" /></a>
        <p><a href="#">This carousel 
		has padding applied to it so you can see hints for the previous and taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
		next images.</a></p>        
		</li>
        <li>
        <a href="#">
		<img alt="" src='@Url.Content("~/Images/News/TitleImages/test.jpg")' width="500" height="330" /></a>
        <p><a href="#">This carousel 
		has padding applied to it so you can see hints for the previous and taaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
		next images.</a></p>        
		</li>*@
	</ul>
</div>